﻿using Xejen.Hosting;
using Xejen.Hosting.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using Xejen.Languages.Abstract;

namespace Xejen.Hosting
{
    /// <summary>
    /// 表示<see cref="IAppHost"/>扩展
    /// </summary>
    /// <creator>marc</creator>
    public static class AppHostExtensions
    {
        /// <summary>
        /// 启用多语言环境
        /// </summary>
        /// <param name="host"><inheritdoc cref="IAppHost" path="/summary"/></param>
        /// <param name="configure">构建器行为</param>
        /// <returns></returns>
        public static IAppHost UseLanguage(this IAppHost host, Action<ILanguageBuilder> configure)
        {
            LanguageBuilder appBuilder = new LanguageBuilder(host);
            configure?.Invoke(appBuilder);

            return host;
        }
    }
}
